---
keywords: ""
root: "/v5.1"
description: "Swift documentation for 'StrideToIterator'"
layout: "default"
title: "StrideToIterator"
---

<div class="intro-declaration"><code class="language-swift">struct StrideToIterator</code></div><p>An iterator for a <code>StrideTo</code> instance.</p>
<table class="standard"><tr><th id="inheritance">Inheritance</th><td><code class="inherits">IteratorProtocol</code></td></tr></table><div class="discussion comment"></div><h3>Instance Methods</h3><div id="next-664f8784e379383402f73aeb98bca97f" class="declaration"><a class="toggle-link" href="#comment-next-664f8784e379383402f73aeb98bca97f">func next() -> Element?</a> <span class="required">Required</span><div class="comment collapse in" id="comment-next-664f8784e379383402f73aeb98bca97f"><p>Advances to the next element and returns it, or <code>nil</code> if no next element
exists.</p>
<p>Once <code>nil</code> has been returned, all subsequent calls return <code>nil</code>.</p>
<h4>Declaration</h4><code class="language-swift">@inlinable public mutating func next() -> Element?</code></div></div>